package com.zzyl.nursing;

import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;

public class FakeDataGenerator {
    
    public static void generateFakeData() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date now = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(now);
        
        // 生成7天的数据
        for (int day = 0; day < 7; day++) {
            // 每天24小时
            for (int hour = 0; hour < 24; hour++) {
                calendar.add(Calendar.HOUR_OF_DAY, -1);
                Date time = calendar.getTime();
                
                // 体温数据 (36.0-37.5°C)
                double bodyTemp = 36.0 + ThreadLocalRandom.current().nextDouble(1.5);
                System.out.println("INSERT INTO your_table VALUES ('" + 
                    UUID.randomUUID().toString() + "','wahtasdas','68d0c757d582f2001851a68f_waht',''," +
                    "'68d0c757d582f2001851a68f','智能定位报警手表','BodyTemp','马嘉祺',0,,," + 
                    String.format("%.1f", bodyTemp) + ",'" + sdf.format(time) + "','" + sdf.format(time) + 
                    "','','','BodyTemp');");
                
                // 心率数据 (60-100 bpm)
                int heartRate = ThreadLocalRandom.current().nextInt(40) + 60;
                System.out.println("INSERT INTO your_table VALUES ('" + 
                    UUID.randomUUID().toString() + "','wahtasdas','68d0c757d582f2001851a68f_waht',''," +
                    "'68d0c757d582f2001851a68f','智能定位报警手表','HeartRate','马嘉祺',0,,," + 
                    heartRate + ",'" + sdf.format(time) + "','" + sdf.format(time) + 
                    "','','','HeartRate');");
                
                // 血氧数据 (90-100%)
                int xueyang = ThreadLocalRandom.current().nextInt(10) + 90;
                System.out.println("INSERT INTO your_table VALUES ('" + 
                    UUID.randomUUID().toString() + "','wahtasdas','68d0c757d582f2001851a68f_waht',''," +
                    "'68d0c757d582f2001851a68f','智能定位报警手表','xueyang','马嘉祺',0,,," + 
                    xueyang + ",'" + sdf.format(time) + "','" + sdf.format(time) + 
                    "','','','xueyang');");
                
                // 电池电量数据 (0-100%)
                int battery = ThreadLocalRandom.current().nextInt(101);
                System.out.println("INSERT INTO your_table VALUES ('" + 
                    UUID.randomUUID().toString() + "','wahtasdas','68d0c757d582f2001851a68f_waht',''," +
                    "'68d0c757d582f2001851a68f','智能定位报警手表','BatteryPercentage','马嘉祺',0,,," + 
                    battery + ",'" + sdf.format(time) + "','" + sdf.format(time) + 
                    "','','','BatteryPercentage');");
            }
        }
    }
    
    public static void main(String[] args) {
        generateFakeData();
    }
}
